/*
 * @Author: 瞿旺兴 18774621495@163.com
 * @Date: 2022-05-13 18:08:44
 * @LastEditors: 瞿旺兴 18774621495@163.com
 * @LastEditTime: 2022-06-25 15:37:35
 * @FilePath: \nien-vue3-admin\src\api\finance\receiverManange.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
// 应收管理
import request from '@/utils/request'

// ----------------------------空海派
// 空海派账单列表
export const getSeaAirSendFinanceAccountlist = function (data) {
  return request({
    url: 'finance/seaAirSendFinanceAccount/list',
    method: 'post',
    data,
  })
}
// 空海派账单详情列表
export const getSeaAirSendFinanceAccountDetail = function (data) {
  return request({
    url: 'finance/seaAirSendFinanceAccount/details',
    method: 'post',
    data,
  })
}
// 空海派订单明细列表
export const getSeaAirSendFinanceAccountOrderDetails = function (data) {
  return request({
    url: 'finance/seaAirSendFinanceAccount/orderDetails',
    method: 'post',
    data,
  })
}
// 空海派账单核销
export const dispatchWriteOffSend = function (data) {
  return request({
    url: 'finance/seaAirSendFinanceAccount/writeOffSend',
    method: 'post',
    data,
  })
}
// 空海派账单反审核
export const dispatchCancelWriteOffSend = function (data) {
  return request({
    url: 'finance/seaAirSendFinanceAccount/cancelWriteOffSend',
    method: 'post',
    data,
  })
}
// 单票剔除
export const singleEliminate = function (data) {
  return request({
    url: 'finance/seaAirSendFinanceAccount/singleEliminate',
    method: 'post',
    data,
  })
}
// 单笔剔除
export const eliminate = function (data) {
  return request({
    url: 'finance/seaAirSendFinanceAccount/eliminate',
    method: 'post',
    data,
  })
}

// 收款单据列表
export const collectionList = function (data) {
  return request({
    url: 'finance/collectionManager/collection',
    method: 'post',
    data,
  })
}
// 推送
export const confirmPushBill = function (id, serialNo) {
  return request({
    url: `finance/seaAirSendFinanceAccount/confirmPushBill/${id}/${serialNo}`,
    method: 'post',
  })
}
// 确认
export const confirmTheBill = function (data) {
  return request({
    url: 'finance/seaAirSendFinanceAccount/confirmTheBill',
    method: 'post',
    data,
  })
}
// 确认前接口
export const queryAccountDetails = function (data) {
  return request({
    url: 'finance/seaAirSendFinanceAccount/queryAccountDetails',
    method: 'post',
    data,
  })
}

// --------------------------空海运、、
// 空海派账单列表
export const getSeaAirTransportFinanceAccountlist = function (data) {
  return request({
    url: 'finance/seaAirTransportFinanceAccount/list',
    method: 'post',
    data,
  })
}
// 空海运账单详情列表
export const getSeaAirTransportFinanceAccountDetail = function (data) {
  return request({
    url: 'finance/seaAirTransportFinanceAccount/details',
    method: 'post',
    data,
  })
}
// 空海派订单明细列表
export const getSeaAirTransportFinanceAccountLadingNoDetails = function (data) {
  return request({
    url: 'finance/seaAirTransportFinanceAccount/ladingNoDetails',
    method: 'post',
    data,
  })
}

// --------------------- 收款管理

// ------------收款
// 列表
export const collectionManagerList = function (data) {
  return request({
    url: 'finance/collectionManager/list',
    method: 'post',
    data,
  })
}
// 新增
export const collectionManagerAdd = function (data) {
  return request({
    url: 'finance/collectionManager/add',
    method: 'post',
    headers: { 'content-type': 'application/x-www-form-urlencoded' },
    data,
  })
}
// 编辑
export const collectionManagerEdit = function (data) {
  return request({
    url: 'finance/collectionManager/edit',
    headers: { 'content-type': 'application/x-www-form-urlencoded' },
    method: 'PUT',
    data,
  })
}
// 删除
export const collectionManagerRemove = function (ids) {
  return request({
    url: `finance/collectionManager/remove/${ ids }`,
    method: 'delete',
  })
}
// 收款账号
export const selectSysCollectionInfoList = function (data) {
  return request({
    url: 'finance/collectionInfo/selectSysCollectionInfoList',
    method: 'post',
    data,
  })
}
// 开票
export const invoicing = function (data) {
  return request({
    url: 'finance/collectionManager/invoicing',
    method: 'post',
    data,
  })
}
// 拆分列表
export const selectSingleCustAllSerialNo = function (params) {
  return request({
    url: 'finance/financialReceivableFee/selectSingleCustAllSerialNo',
    method: 'get',
    params,
  })
}
// 拆分保存
export const splitCollectionAmount = function (data) {
  return request({
    url: 'finance/collectionManager/splitCollectionAmount',
    method: 'post',
    data,
  })
}

// -------收款日志
// 列表
export const getLogList = function (data) {
  return request({
    url: 'finance/collection/record/query',
    method: 'post',
    data,
  })
}
// 导出
export const logExport = function () {
  return request({
    url: 'finance/collection/record/export',
    method: 'post',
    data: {},
  })
}
// 出纳确认
export const cashierConfirm = function (data) {
  return request({
    url: 'finance/collection/record/confirm',
    method: 'post',
    data,
  })
}
//   查询收款人
export const queryReceivingUser = function (data) {
  return request({
    url: 'finance/collection/record/queryReceivingUser',
    method: 'post',
    data,
  })
}

//-------------------- 末端财务
// 列表
export const terminalFinanceList = function (params) {
  return request({
    url: 'order/orderEnd/terminalFinanceList',
    method: 'get',
    params,
  })
}

// 详情列表
export const terminalFinanceDetailsList = function (params) {
  return request({
    url: 'order/orderEnd/detailsList',
    method: 'get',
    params,
  })
}

